<?php
/**
 * 商品属性名表 - 不影响销售的属性
 *
 * @author Zeon <scplay@gmail.com>
 * @date 2018/6/7
 * @copyright PanxSoft Inc.
 */
namespace App\Models\Panx;

use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;

/**
 * @property Collection attributeValues
 * @property int id
 */
class Attribute extends Model
{
    protected $table = 'attributes';

    protected $guarded = [];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function attributeValues()
    {
        return $this->hasMany(AttributeValue::class, 'attribute_id', 'id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function productMod()
    {
        return $this->belongsTo(ProductMod::class, 'product_mod_id', 'id');
    }

}
